import 'package:enterprise_v6_app/generated/json/base/json_convert_content.dart';
import 'package:enterprise_v6_app/app/data/entities/inspec/ins_task_detail_entity.dart';

InsTaskDetailEntity $InsTaskDetailEntityFromJson(Map<String, dynamic> json) {
  final InsTaskDetailEntity insTaskDetailEntity = InsTaskDetailEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    insTaskDetailEntity.id = id;
  }
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    insTaskDetailEntity.companyCode = companyCode;
  }
  final String? hazardCode = jsonConvert.convert<String>(json['hazardCode']);
  if (hazardCode != null) {
    insTaskDetailEntity.hazardCode = hazardCode;
  }
  final String? riskObjectId = jsonConvert.convert<String>(json['riskObjectId']);
  if (riskObjectId != null) {
    insTaskDetailEntity.riskObjectId = riskObjectId;
  }
  final String? riskObjectName = jsonConvert.convert<String>(json['riskObjectName']);
  if (riskObjectName != null) {
    insTaskDetailEntity.riskObjectName = riskObjectName;
  }
  final String? riskUnitId = jsonConvert.convert<String>(json['riskUnitId']);
  if (riskUnitId != null) {
    insTaskDetailEntity.riskUnitId = riskUnitId;
  }
  final String? riskUnitName = jsonConvert.convert<String>(json['riskUnitName']);
  if (riskUnitName != null) {
    insTaskDetailEntity.riskUnitName = riskUnitName;
  }
  final String? riskEventId = jsonConvert.convert<String>(json['riskEventId']);
  if (riskEventId != null) {
    insTaskDetailEntity.riskEventId = riskEventId;
  }
  final String? riskEventName = jsonConvert.convert<String>(json['riskEventName']);
  if (riskEventName != null) {
    insTaskDetailEntity.riskEventName = riskEventName;
  }
  final String? riskMeasureId = jsonConvert.convert<String>(json['riskMeasureId']);
  if (riskMeasureId != null) {
    insTaskDetailEntity.riskMeasureId = riskMeasureId;
  }
  final String? riskMeasureDesc = jsonConvert.convert<String>(json['riskMeasureDesc']);
  if (riskMeasureDesc != null) {
    insTaskDetailEntity.riskMeasureDesc = riskMeasureDesc;
  }
  final String? checkTaskId = jsonConvert.convert<String>(json['checkTaskId']);
  if (checkTaskId != null) {
    insTaskDetailEntity.checkTaskId = checkTaskId;
  }
  final String? troubleshootContent = jsonConvert.convert<String>(json['troubleshootContent']);
  if (troubleshootContent != null) {
    insTaskDetailEntity.troubleshootContent = troubleshootContent;
  }
  final int? checkCycle = jsonConvert.convert<int>(json['checkCycle']);
  if (checkCycle != null) {
    insTaskDetailEntity.checkCycle = checkCycle;
  }
  final String? checkCycleUnit = jsonConvert.convert<String>(json['checkCycleUnit']);
  if (checkCycleUnit != null) {
    insTaskDetailEntity.checkCycleUnit = checkCycleUnit;
  }
  final String? workStartTime = jsonConvert.convert<String>(json['workStartTime']);
  if (workStartTime != null) {
    insTaskDetailEntity.workStartTime = workStartTime;
  }
  final int? checkStatus = jsonConvert.convert<int>(json['checkStatus']);
  if (checkStatus != null) {
    insTaskDetailEntity.checkStatus = checkStatus;
  }
  final int? allocationId = jsonConvert.convert<int>(json['allocationId']);
  if (allocationId != null) {
    insTaskDetailEntity.allocationId = allocationId;
  }
  final String? allocationName = jsonConvert.convert<String>(json['allocationName']);
  if (allocationName != null) {
    insTaskDetailEntity.allocationName = allocationName;
  }
  final dynamic allocationType = json['allocationType'];
  if (allocationType != null) {
    insTaskDetailEntity.allocationType = allocationType;
  }
  final dynamic workTypeDicId = json['workTypeDicId'];
  if (workTypeDicId != null) {
    insTaskDetailEntity.workTypeDicId = workTypeDicId;
  }
  final dynamic taskNum = json['taskNum'];
  if (taskNum != null) {
    insTaskDetailEntity.taskNum = taskNum;
  }
  final String? checkTime = jsonConvert.convert<String>(json['checkTime']);
  if (checkTime != null) {
    insTaskDetailEntity.checkTime = checkTime;
  }
  final String? checkUserId = jsonConvert.convert<String>(json['checkUserId']);
  if (checkUserId != null) {
    insTaskDetailEntity.checkUserId = checkUserId;
  }
  final String? checkUserName = jsonConvert.convert<String>(json['checkUserName']);
  if (checkUserName != null) {
    insTaskDetailEntity.checkUserName = checkUserName;
  }
  final dynamic mobileMe = json['mobileMe'];
  if (mobileMe != null) {
    insTaskDetailEntity.mobileMe = mobileMe;
  }
  final dynamic isDefend = json['isDefend'];
  if (isDefend != null) {
    insTaskDetailEntity.isDefend = isDefend;
  }
  final dynamic dangerInvestigationId = json['dangerInvestigationId'];
  if (dangerInvestigationId != null) {
    insTaskDetailEntity.dangerInvestigationId = dangerInvestigationId;
  }
  final dynamic createBy = json['createBy'];
  if (createBy != null) {
    insTaskDetailEntity.createBy = createBy;
  }
  final dynamic createById = json['createById'];
  if (createById != null) {
    insTaskDetailEntity.createById = createById;
  }
  final dynamic createByDep = json['createByDep'];
  if (createByDep != null) {
    insTaskDetailEntity.createByDep = createByDep;
  }
  final dynamic createByMobile = json['createByMobile'];
  if (createByMobile != null) {
    insTaskDetailEntity.createByMobile = createByMobile;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    insTaskDetailEntity.createDate = createDate;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    insTaskDetailEntity.updateBy = updateBy;
  }
  final dynamic updateById = json['updateById'];
  if (updateById != null) {
    insTaskDetailEntity.updateById = updateById;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    insTaskDetailEntity.updateDate = updateDate;
  }
  final String? deleted = jsonConvert.convert<String>(json['deleted']);
  if (deleted != null) {
    insTaskDetailEntity.deleted = deleted;
  }
  final String? isInspection = jsonConvert.convert<String>(json['isInspection']);
  if (isInspection != null) {
    insTaskDetailEntity.isInspection = isInspection;
  }
  final String? workEndTime = jsonConvert.convert<String>(json['workEndTime']);
  if (workEndTime != null) {
    insTaskDetailEntity.workEndTime = workEndTime;
  }
  final String? faultLastTime = jsonConvert.convert<String>(json['faultLastTime']);
  if (faultLastTime != null) {
    insTaskDetailEntity.faultLastTime = faultLastTime;
  }
  final String? supplementaryInspectionTime = jsonConvert.convert<String>(json['supplementaryInspectionTime']);
  if (supplementaryInspectionTime != null) {
    insTaskDetailEntity.supplementaryInspectionTime = supplementaryInspectionTime;
  }
  final dynamic workKind = json['workKind'];
  if (workKind != null) {
    insTaskDetailEntity.workKind = workKind;
  }
  final dynamic startRefreshTime = json['startRefreshTime'];
  if (startRefreshTime != null) {
    insTaskDetailEntity.startRefreshTime = startRefreshTime;
  }
  final dynamic endRefreshTime = json['endRefreshTime'];
  if (endRefreshTime != null) {
    insTaskDetailEntity.endRefreshTime = endRefreshTime;
  }
  final String? planName = jsonConvert.convert<String>(json['planName']);
  if (planName != null) {
    insTaskDetailEntity.planName = planName;
  }
  final String? planId = jsonConvert.convert<String>(json['planId']);
  if (planId != null) {
    insTaskDetailEntity.planId = planId;
  }
  final String? inspectionDescription = jsonConvert.convert<String>(json['inspectionDescription']);
  if (inspectionDescription != null) {
    insTaskDetailEntity.inspectionDescription = inspectionDescription;
  }
  final List<String>? inspectionPhotos = (json['inspectionPhotos'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (inspectionPhotos != null) {
    insTaskDetailEntity.inspectionPhotos = inspectionPhotos;
  }
  final List<String>? inspectionVideos = (json['inspectionVideos'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (inspectionVideos != null) {
    insTaskDetailEntity.inspectionVideos = inspectionVideos;
  }
  final List<String>? patrolVoices = (json['patrolVoices'] as List<dynamic>?)?.map(
          (e) => jsonConvert.convert<String>(e) as String).toList();
  if (patrolVoices != null) {
    insTaskDetailEntity.patrolVoices = patrolVoices;
  }
  return insTaskDetailEntity;
}

Map<String, dynamic> $InsTaskDetailEntityToJson(InsTaskDetailEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['companyCode'] = entity.companyCode;
  data['hazardCode'] = entity.hazardCode;
  data['riskObjectId'] = entity.riskObjectId;
  data['riskObjectName'] = entity.riskObjectName;
  data['riskUnitId'] = entity.riskUnitId;
  data['riskUnitName'] = entity.riskUnitName;
  data['riskEventId'] = entity.riskEventId;
  data['riskEventName'] = entity.riskEventName;
  data['riskMeasureId'] = entity.riskMeasureId;
  data['riskMeasureDesc'] = entity.riskMeasureDesc;
  data['checkTaskId'] = entity.checkTaskId;
  data['troubleshootContent'] = entity.troubleshootContent;
  data['checkCycle'] = entity.checkCycle;
  data['checkCycleUnit'] = entity.checkCycleUnit;
  data['workStartTime'] = entity.workStartTime;
  data['checkStatus'] = entity.checkStatus;
  data['allocationId'] = entity.allocationId;
  data['allocationName'] = entity.allocationName;
  data['allocationType'] = entity.allocationType;
  data['workTypeDicId'] = entity.workTypeDicId;
  data['taskNum'] = entity.taskNum;
  data['checkTime'] = entity.checkTime;
  data['checkUserId'] = entity.checkUserId;
  data['checkUserName'] = entity.checkUserName;
  data['mobileMe'] = entity.mobileMe;
  data['isDefend'] = entity.isDefend;
  data['dangerInvestigationId'] = entity.dangerInvestigationId;
  data['createBy'] = entity.createBy;
  data['createById'] = entity.createById;
  data['createByDep'] = entity.createByDep;
  data['createByMobile'] = entity.createByMobile;
  data['createDate'] = entity.createDate;
  data['updateBy'] = entity.updateBy;
  data['updateById'] = entity.updateById;
  data['updateDate'] = entity.updateDate;
  data['deleted'] = entity.deleted;
  data['isInspection'] = entity.isInspection;
  data['workEndTime'] = entity.workEndTime;
  data['faultLastTime'] = entity.faultLastTime;
  data['supplementaryInspectionTime'] = entity.supplementaryInspectionTime;
  data['workKind'] = entity.workKind;
  data['startRefreshTime'] = entity.startRefreshTime;
  data['endRefreshTime'] = entity.endRefreshTime;
  data['planName'] = entity.planName;
  data['planId'] = entity.planId;
  data['inspectionDescription'] = entity.inspectionDescription;
  data['inspectionPhotos'] = entity.inspectionPhotos;
  data['inspectionVideos'] = entity.inspectionVideos;
  data['patrolVoices'] = entity.patrolVoices;
  return data;
}

extension InsTaskDetailEntityExtension on InsTaskDetailEntity {
  InsTaskDetailEntity copyWith({
    String? id,
    String? companyCode,
    String? hazardCode,
    String? riskObjectId,
    String? riskObjectName,
    String? riskUnitId,
    String? riskUnitName,
    String? riskEventId,
    String? riskEventName,
    String? riskMeasureId,
    String? riskMeasureDesc,
    String? checkTaskId,
    String? troubleshootContent,
    int? checkCycle,
    String? checkCycleUnit,
    String? workStartTime,
    int? checkStatus,
    int? allocationId,
    String? allocationName,
    dynamic allocationType,
    dynamic workTypeDicId,
    dynamic taskNum,
    String? checkTime,
    String? checkUserId,
    String? checkUserName,
    dynamic mobileMe,
    dynamic isDefend,
    dynamic dangerInvestigationId,
    dynamic createBy,
    dynamic createById,
    dynamic createByDep,
    dynamic createByMobile,
    String? createDate,
    String? updateBy,
    dynamic updateById,
    String? updateDate,
    String? deleted,
    String? isInspection,
    String? workEndTime,
    String? faultLastTime,
    String? supplementaryInspectionTime,
    dynamic workKind,
    dynamic startRefreshTime,
    dynamic endRefreshTime,
    String? planName,
    String? planId,
    String? inspectionDescription,
    List<String>? inspectionPhotos,
    List<String>? inspectionVideos,
    List<String>? patrolVoices,
  }) {
    return InsTaskDetailEntity()
      ..id = id ?? this.id
      ..companyCode = companyCode ?? this.companyCode
      ..hazardCode = hazardCode ?? this.hazardCode
      ..riskObjectId = riskObjectId ?? this.riskObjectId
      ..riskObjectName = riskObjectName ?? this.riskObjectName
      ..riskUnitId = riskUnitId ?? this.riskUnitId
      ..riskUnitName = riskUnitName ?? this.riskUnitName
      ..riskEventId = riskEventId ?? this.riskEventId
      ..riskEventName = riskEventName ?? this.riskEventName
      ..riskMeasureId = riskMeasureId ?? this.riskMeasureId
      ..riskMeasureDesc = riskMeasureDesc ?? this.riskMeasureDesc
      ..checkTaskId = checkTaskId ?? this.checkTaskId
      ..troubleshootContent = troubleshootContent ?? this.troubleshootContent
      ..checkCycle = checkCycle ?? this.checkCycle
      ..checkCycleUnit = checkCycleUnit ?? this.checkCycleUnit
      ..workStartTime = workStartTime ?? this.workStartTime
      ..checkStatus = checkStatus ?? this.checkStatus
      ..allocationId = allocationId ?? this.allocationId
      ..allocationName = allocationName ?? this.allocationName
      ..allocationType = allocationType ?? this.allocationType
      ..workTypeDicId = workTypeDicId ?? this.workTypeDicId
      ..taskNum = taskNum ?? this.taskNum
      ..checkTime = checkTime ?? this.checkTime
      ..checkUserId = checkUserId ?? this.checkUserId
      ..checkUserName = checkUserName ?? this.checkUserName
      ..mobileMe = mobileMe ?? this.mobileMe
      ..isDefend = isDefend ?? this.isDefend
      ..dangerInvestigationId = dangerInvestigationId ?? this.dangerInvestigationId
      ..createBy = createBy ?? this.createBy
      ..createById = createById ?? this.createById
      ..createByDep = createByDep ?? this.createByDep
      ..createByMobile = createByMobile ?? this.createByMobile
      ..createDate = createDate ?? this.createDate
      ..updateBy = updateBy ?? this.updateBy
      ..updateById = updateById ?? this.updateById
      ..updateDate = updateDate ?? this.updateDate
      ..deleted = deleted ?? this.deleted
      ..isInspection = isInspection ?? this.isInspection
      ..workEndTime = workEndTime ?? this.workEndTime
      ..faultLastTime = faultLastTime ?? this.faultLastTime
      ..supplementaryInspectionTime = supplementaryInspectionTime ?? this.supplementaryInspectionTime
      ..workKind = workKind ?? this.workKind
      ..startRefreshTime = startRefreshTime ?? this.startRefreshTime
      ..endRefreshTime = endRefreshTime ?? this.endRefreshTime
      ..planName = planName ?? this.planName
      ..planId = planId ?? this.planId
      ..inspectionDescription = inspectionDescription ?? this.inspectionDescription
      ..inspectionPhotos = inspectionPhotos ?? this.inspectionPhotos
      ..inspectionVideos = inspectionVideos ?? this.inspectionVideos
      ..patrolVoices = patrolVoices ?? this.patrolVoices;
  }
}
